{% extends "admin/base.html" %}

{% block scriptBlock %}
<link href="../../static/food/css/jquery.pagination.css" rel="stylesheet" type="text/css"  media="all" />
<script type="text/javascript" src="../../static/js/jquery.pagination.min.js"></script>
<script type="text/javascript" src="../../static/js/del_order.js"></script>
{% endblock %}



{% block crumbBlock %}
    <div class="crumb-list"><i class="icon-font"></i><a href="/admin/index">首页</a><span class="crumb-step">&gt;</span><span class="crumb-name">订单管理</span></div>
{% endblock %}


{% block contentBlock %}
<div class="search-wrap">
    <div class="search-content">
    </div>
</div>
<div class="result-wrap">
    <form name="myform" id="myform" method="post">
        <div class="result-content">
            <table class="result-tab" width="100%">
                <tr>
                    <th>订单号码</th>
                    <th>下单时间</th>
                    <th>菜品名称</th>
                    <th>菜品价格</th>
                    <th>菜品数量</th>
                    <th>菜品总价</th>
                    <th>客户姓名</th>
                    <th>客户电话</th>
                    <th>家庭地址</th>
                    <th>备注信息</th>
                    <th>操作</th>
                </tr>
                {% for order in data.order_list %}
                    <tr>
                        <td>{{ order.order_list_num }}</td>
                        <td>{{ order.create_time }}</td>
                        <td>{{ order.food.food_name }}</td>
                        <td>{{ order.price }}</td>
                        <td>{{ order.count }}</td>
                        <td>{{ order.sum_price }}</td>
                        <td>{{ order.username }}</td>
                        <td>{{ order.phone_number }}</td>
                        <td>{{ order.address }}</td>
                        <td>{{ order.remark }}</td>
                        <td>
                            <a class="link-del" href="javascript:;" order_id="{{ order.id }}">删除</a>
                        </td>
                    </tr>
                {% endfor %}
            </table>
        </div>
    </form>
</div>
{% endblock %}

{% block pageBlock %}
<div id="pagination" class="page"></div>
    <script>
        // 调用父页面的方法改变菜单指示
        $(function(){
            $("#pagination").pagination({
                currentPage: {{ data.current_page }},
                totalPage: {{ data.total_page }},
                callback: function(current) {
                    window.location.href="/admin/order?p="+current;
                }
            });
        });
    </script>
{% endblock %}